package nccloud.hrjx.bill.jxxsdatavo.action;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import nc.bs.logging.Logger;
import nccloud.framework.core.exception.ExceptionUtils;
import nccloud.framework.web.action.itf.ICommonAction;
import nccloud.framework.web.container.IRequest;
import nccloud.hrjx.bill.jxxsdatavo.bill.util.CommonUtil;

public class JxXsFlowAction implements ICommonAction {

	@Override
	public Object doAction(IRequest request) {

		JSONObject root = JSONObject.parseObject(request.read());

		JSONArray pksArr = root.getJSONArray("pks");

		String[] pks = new String[pksArr.size()];
		for (int i = 0; i < pks.length; i++) {
			pks[i] = pksArr.getString(i);
		}

		String action = root.getString("action");
		String message = root.getString("message");

		try {
			CommonUtil.getFinancingcostMaintainService().workflow(pks, action, message);
		} catch (Exception e) {
			Logger.error(e);
			ExceptionUtils.wrapException(e);
		}

		return null;
	}

}
